package com.wl.cloud;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author: wanglin
 * @date: 2023-07-12 周三
 * @Version: 1.0
 * @Description:
 */
@Slf4j
@SpringBootApplication(scanBasePackages = "com.wl.cloud")
public class BackBootApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext application = SpringApplication.run(BackBootApplication.class, args);
        Environment env = application.getEnvironment();
        String ip = null;
        try {
            ip = InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        String port = env.getProperty("server.port");
        log.info("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~start success~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        log.info("\tProject access address：" + "http://" + ip + ":" + port + "/swagger-ui.html");
        log.info("\tDruid access address：" + "http://" + ip + ":" + port + "/druid/index.html");
    }
}
